<%@ page contentType="text/html; charset=UTF-8" language="java" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp" %>

<c:if test="${fn:length(PageForm.obj) == 0}" >	
	<div style="padding-top:5px;">
		<table style="border: 1px solid #C0C0C0;">	
			<tr>
				<td>
					<div style="padding:20px;font-size: 16px;font-weight: 300;letter-spacing: 4px;">
						<img src="${appPath }/resource/image/1320894006_Problem.png" style="vertical-align:middle;"/>
						<span style="color: #3B5998;">目前尚相關表單資料</span>
					</div>
				</td>
			</tr>
		</table>
	</div>
</c:if>

<c:if test="${fn:length(PageForm.obj) != 0}" >	
	<table style="width:800px;border:1px solid #D2D9E7;">						
		<tr class="trHeader">
			<td style="width:05%;text-align: center;">&nbsp;</td>
			<td style="width:10%;text-align: center;font-weight: 600;">資料編號</td>
			<td style="width:37%;text-align: center;font-weight: 600;">原文標題</td>
			<td style="width:20%;text-align: center;font-weight: 600;">作者</td> 
			<td style="width:08%;text-align: center;font-weight: 600;">出版年</td> 
			<td style="width:10%;text-align: center;font-weight: 600;">
				狀態
				<a href="javascript:void(0);" onclick="$('#info2Overlay').fadeIn('fast')">
					<img src="${appPath }/resource/image/1320847230_information.png" style="vertical-align:middle;padding-left:3px;" border="0"/>
				</a>
			</td> 
			<td style="width:10%;text-align: center;font-weight: 600;">動作</td> 
		</tr>
		<c:forEach items="${PageForm.obj }" var="agricultureAndFood" varStatus="s">		
			<tr class="trContent">
				<td style="text-align: center;font-weight: 600">
					${PageForm.firstResult + s.count }
				</td> 
				<td style="text-align: center;letter-spacing: 2px;">
					<span  style="color: green;">${agricultureAndFood.rec_no }</span>
				</td> 
				<td style="padding-left:10px;">
					
					<span id="LIST_TITLE_O_${agricultureAndFood.seq_no }">
						${agricultureAndFood.title_o  == '' ? '&nbsp;' : agricultureAndFood.title_o}
					</span>
				</td> 
				<td style="padding-left:10px;">
					<span id="LIST_AUTHOR_${agricultureAndFood.seq_no }">
						${agricultureAndFood.author  == '' ? '&nbsp;' : agricultureAndFood.author}
					</span>
				</td> 
				<td style="text-align: center;">
					<span id="LIST_YEAR_${agricultureAndFood.seq_no }">
						<c:choose>
							<c:when test="${agricultureAndFood.year == 1}">
								不明
							</c:when>
							<c:otherwise>
								${agricultureAndFood.year}
							</c:otherwise>
						</c:choose>
					</span>
				</td>			
				<td style="text-align: center;">
					<span id="LIST_FLOW_${agricultureAndFood.seq_no }">
						<c:if test="${agricultureAndFood.flow == '0'}" >
							<%-- <span style="color:red">暫存</span> --%>
							<img src="${appPath }/resource/image/switch01.png"/>
						</c:if>
						
						<c:if test="${agricultureAndFood.flow == '1'}" >
							<%-- <span style="color:blue">完成</span> --%>
							<img src="${appPath }/resource/image/switch02.png"/>
						</c:if>
						
						<c:if test="${agricultureAndFood.flow == '2'}" >
							<%-- <span style="color:blue">已檢核</span> --%>
							<img src="${appPath }/resource/image/switch03.png"/>
						</c:if>
					</span>
				</td> 
				<td style="text-align: center;">
					<span onclick="view('${agricultureAndFood.seq_no }',1);" style="color:green;cursor: pointer;">檢視</span> | 
					<span onclick="view('${agricultureAndFood.seq_no }',2);" style="color:green;cursor: pointer;">編輯</span>
				</td>
			</tr>
		</c:forEach>	
	</table>
	<div style="width:650px;padding-top:10px;">${PageForm.pageInfo}</div>
</c:if>

<form:form method="post" modelAttribute="PageForm" >
<form:hidden path="nowPage" />
<form:hidden path="firstResult" />
<form:hidden path="rowsPerPage" />
<form:hidden path="totalPages" />
<form:hidden path="totalRows" />
<form:hidden path="queryType" />
<form:hidden path="requery" />
<form:hidden path="basicFormPriority" />
</form:form>

<input type="hidden" id="thisFormType" value="1"/>
